home *** CD-ROM | disk | FTP | other *** search
- /* arexx Script
- */
-
- options results
- parse ARG Port b
-
- ADDRESS value Port
-
- pp_GetDepth
- D=result
- pp_GetWidth
- W=result
- pp_GetHeight
- H=result
-
- pp_CountFrames
- count=result
- IF count<2 then DO
- pp_Warn 'Make*an*Anim*first.'
- EXIT
- END
-
- pp_GetCurrentBuffer
- CBf=result
- pp_GetCurrentBrush
- B0=result
-
- if D<24 then DO
- pp_Psave "ram:palette.trash" 0
- END
-
- pp_FindEmptyBrush
- Brush=result
- if Brush=-1 then DO
- pp_Warn "can't*find*empty|Brush."
- EXIT
- END
- pp_SetBrush Brush
-
- pp_FindEMptyBuffer
- Bf=result
- if Bf=-1 then DO
- pp_Warn "can't*find*empty|Buffer."
- EXIT
- END
- pp_SetBuffer Bf
-
- file="ram:"
- type=0
-
- if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/MkTransferAnim') THEN DO
- IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/MkTransferAnim', "R") then DO
- file = READLN('lfile')
- type=READLN('lfile')
- if UPPER(file)='RAM DISK:' then DO
- file='ram:'
- end
- CALL CLOSE('lfile')
- file2=""
- do i=1 to LENGTH(file)
- a=SUBSTR(file,i,1)
- if a=" " then DO
- a="*"
- END
- file2=file2||a
- END
- file=file2
- END
- END
-
- pp_DialogInit 250 100 "*SAVE*Transfer*Animation" 3
- pp_String 0 50 12 150 16 "Path" 1 100 file
- pp_Getfile 1 205 13 0 "Select*Path" 1 file
- pp_Cycle 2 70 40 100 16 "Browser" 1 "IBrowse|Aweb|Voyager" type
- pp_Dialog
-
- rc=result
- if rc=0 then
- do
- pp_PermitRefresh
- EXIT
- end
-
- pp_GetDialog 0
- file=result
-
- pp_GetDialog 2
- type=result
-
- if Upper(file)='RAM DISK:' then DO
- file='ram:'
- end
-
- CALL SavePrefs('MkTransferAnim',file,type)
-
- if type=0 then DO
- file=file||'def_TransferAnimation'
- END
- IF type=1 then DO
- file=file||'def_transferanim'
- END
- IF type=2 then DO
- file=file||'TransferAnim'
- END
-
- pp_New W*Count H D
- pp_GetWidth
- if result=0 then DO
- pp_Warn "Not*enough*memory."
- EXIT
- END
-
- if D<24 then DO
- pp_Pload "ram:palette.trash"
- ADDRESS COMMAND
- 'delete >nil: ram:palette.trash'
- ADDRESS value Port
- END
-
- pp_SetBuffer CBf
- pp_GotoFrame 1
-
- DO i=1 to count
- pp_Pickbrush 0 0 W H
- X2=W/2+(i-1)*W
- Y2=H/2
- pp_SetBuffer Bf
- pp_plot x2 Y2
- pp_SetBuffer CBf
- pp_NextFrame
- END
-
- pp_SetBuffer Bf
- pp_SavePrefs 0 1 100 0 0
- pp_Save file
- ADDRESS COMMAND
- 'copy PerfectPaint:Icons/Anim.info '||'"'||file||'"'||'.info'
- ADDRESS value Port
- IF type=0 then DO
- PP_AddtoolType file 'WIDTH' W
- pp_AddToolTYpe file 'HEIGHT' H
- pp_AddToolType file 'FRAMES' count
- END
- IF type=1 then DO
- pp_AddToolType file 'SIZE' W||","||H
- pp_AddToolType file 'FIRST' "0,0"
- pp_AddToolType file 'FRAMES' count
- pp_AddToolType file 'DELTA' W||",0"
- pp_AddToolType file 'REST' "0,0"
- END
- IF type=2 then DO
- pp_AddToolType file 'FRAMEWIDTH' W
- END
-
- pp_ClearCurrentBuffer
- pp_SetBuffer CBf
-
- pp_FreeBrush
- pp_SetBrush B0
-
- EXIT
-
- SavePrefs: PROCEDURE
-
- Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
-
- if EXISTS(Prefname) THEN DO
- ADDRESS COMMAND
- 'delete >nil: '||Prefname
- END
-
- IF OPEN('pfile',PrefName,'W') THEN DO
-
- do i=2 to ARG()
- CALL WRITELN('pfile',ARG(i))
- end
-
- CALL CLOSE('pfile')
-
- RETURN
-
-
-
-
-